//
//  NewsViewController.m
//  oschina
//
//  Created by 如佳 陈 on 15/5/30.
//  Copyright (c) 2015年 crj. All rights reserved.
//

#import "NewsViewController.h"
#import <AFNetworking/AFNetworking.h>
#import <Ono/Ono.h>
#import <AFOnoResponseSerializer/AFOnoResponseSerializer.h>
#import "TweetModel.h"
#import "NewsModel.h"
#import "TestViewController.h"

@interface NewsViewController()

@end

@implementation NewsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setTagBarBackgroundColor:[UIColor whiteColor]];
    self.tagBarTextColor = [UIColor lightGrayColor];
    self.tagBarTintColor = __MAIN_GREEN_COLOR;
    self.titles = @[@"资讯", @"热点", @"博客", @"推荐"];
    UIViewController *vc1 = [[UIViewController alloc]init];
    vc1.view.backgroundColor = [UIColor redColor];
    UIViewController *vc2 = [[UIViewController alloc]init];
    vc2.view.backgroundColor = [UIColor blueColor];
    UIViewController *vc3 = [[UIViewController alloc]init];
    vc3.view.backgroundColor = [UIColor greenColor];
    TestViewController *vc4 = [[TestViewController alloc]init];
    vc4.view.backgroundColor = [UIColor purpleColor];
    self.viewControllers = @[vc4,vc1,vc2,vc3];
//    
//    
////    NSString *url = @"http://www.oschina.net/action/api/news_list?show=month";
//    NSString *url = @"http://www.oschina.net/action/api/tweet_list?uid=0&pageIndex=0&pageSize=20";
//    AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc]init];
//    manager.responseSerializer = [AFOnoResponseSerializer XMLResponseSerializer];
//    [manager GET:url parameters:nil success:^(AFHTTPRequestOperation *operation, ONOXMLDocument *responseObject) {
//        NSArray *arr = [TweetModel listWithXMLDocumentPath:[responseObject XPath:@"//tweet"]];
//        NSLog(@"%@", arr);
//    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        
//    }];
    
}
//
//- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
//    SwipeableViewController *vc = [[SwipeableViewController alloc]init];
//    vc.hidesBottomBarWhenPushed = YES;
//    [self.navigationController pushViewController:vc animated:YES];
//}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */
@end
